package cn.coder.jdbc2.session;

import java.io.InputStream;
import java.io.Reader;

import cn.coder.jdbc2.config.Configuration;
import cn.coder.jdbc2.config.builder.XmlConfigBuilder;

public class SqlSessionFactoryBuilder {
	public SqlSessionFactory build(InputStream inputStream) {
        //解析配置,封装Configuration对象,
        XmlConfigBuilder parser = new XmlConfigBuilder(inputStream);
        return build(parser.parse());
    }
    
    
    public SqlSessionFactory build(Reader reader) {
        //TO DO
        return null;
    }
    
    public SqlSessionFactory build(Configuration configuration) {
        return new DefaultSqlSessionFactory(configuration);
    }
}
